bch: CashTokens transparency KAT (CHIP-2022-02 transparent-carry pin) - #242
Merged
Conversation
Pins the M1 §4 invariant that the embedded daemon carries CashToken txs unchanged: the 0xef token prefix lives inside the CompactSize-length-prefixed TxOut scriptPubKey, so the SHA256d serializer treats it as opaque locking bytecode. Asserts lossless serialize/deserialize round-trip, verbatim byte survival, <len><blob> framing with no prefix special-casing, and binding into the tx_id pre-image (tokens not invisible to CTOR/merkle). Closes the test gap behind the transaction.hpp and template_builder.hpp transparency comments. Fenced src/impl/bch/test/ only; no p2pool-merged-v36 surface.
The test registers via add_test, so ctest -R "^bch_" runs it, but both COIN_BCH jobs (x86_64 and ASan) build an explicit target list that omitted it. ctest then failed to find the unbuilt executable, reding both legs while the test built+passed green on an incremental local tree. Append the target after bch_coinbase_kat_bytevector_test in both job lists. BCH test-list append only; no cross-coin or shared CI logic surface.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
M5 conform-pass slice. Pins the M1 §4 invariant that the embedded BCH daemon carries CashToken txs unchanged.
The 0xef CHIP-2022-02 token prefix lives inside the CompactSize-length-prefixed TxOut scriptPubKey, so the SHA256d tx serializer treats it as opaque locking bytecode — no token-aware parse, no field rewrite. Until now this was asserted only by comment (transaction.hpp:19-22, template_builder.hpp:11).
Asserts:
<CompactSize len><blob>, len == whole blob (prefix not split out)Local: built + ran green under COIN_BCH build (ctest #49 PASS, 123-byte tx).
Scope: fenced
src/impl/bch/test/only. p2pool-merged-v36 surface: NONE.